// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   UserFilter.java

package com.crm.filter;

import java.io.IOException;
import java.util.Date;
import javax.servlet.*;
import javax.servlet.http.*;

public class UserFilter
	implements Filter
{

	public UserFilter()
	{
	}

	public void init(FilterConfig filterconfig)
		throws ServletException
	{
	}

	public void doFilter(ServletRequest servletrequest, ServletResponse servletresponse, FilterChain filterchain)
		throws IOException, ServletException
	{
		HttpServletRequest request = (HttpServletRequest)servletrequest;
		HttpServletResponse response = (HttpServletResponse)servletrequest;
		HttpSession session = request.getSession();
		Date d = new Date();
		if (session.getAttribute("user") == null)
			response.sendRedirect((new StringBuilder(String.valueOf(request.getContextPath()))).append("/login.jsp").toString());
		else
			filterchain.doFilter(servletrequest, servletresponse);
	}

	public void destroy()
	{
	}
}
